package com.boyin.user.controller;

import com.boyin.user.service.OrderRemote;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sh-sunb6
 * @description
 * @date 2019-06-05 14:25
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    OrderRemote orderRemote;

    @Value("${server.port}")
    String port;

    @GetMapping("getUserPort")
    public String getUserPort() {

        return "user-service port：" + port;
    }

    @GetMapping("getOrderPort")
    public String getOrderPort() {

        return "user-order-service port(调用order-service服务)：" + orderRemote.getOrderPort();
    }



}
